package com.ks.member.service;

import com.ks.core.base.OperationContext;
import com.ks.core.dto.OperateIndentifyTransfer;
import com.ks.core.dto.SearchCriteriaBase;
import com.ks.member.controller.dto.MemberBaseRequest;
import com.ks.member.controller.response.MemberBaseDto;
import com.ks.member.entity.MemberBase;
import com.baomidou.mybatisplus.service.IService;

import java.util.Map;

/**
 * <p>
 * 会员系统  用户基本信息 服务类
 * </p>
 *
 * @author kingdee123
 * @since 2020-12-22
 */
public interface IMemberBaseService extends IService<MemberBase> {

    Map<String, Object> getMemberBaseUserCount(OperationContext context);

    Map<String, Object> getMemberBaseUserAdminCount(OperationContext context);

    Map<String, Object> getMemberBaseAddressCount(OperationContext context);

    Map<String, Object> getMemberBaseAdminCount(OperationContext context);

    Map<String, Object> getMemberBaseList(OperationContext context, SearchCriteriaBase searchCriteriaBase);


    Map<String, Object> getMemberBaseAdminList(OperationContext context, SearchCriteriaBase searchCriteriaBase);

    int addStartMember(OperationContext context, MemberBase memberBase);

    /**
     * 微会员登录接口
     *
     * @param OpenID
     * @param TenandID
     * @return
     */
    Map<String, Object> login(String OpenID, String TenandID);

    /**
     * 生成tocken
     *
     * @param memberBase
     * @return
     */
    String getAuthToken(MemberBase memberBase);

    /**
     * 微会员退出接口
     *
     * @param
     * @return
     */
    int SignOut(String token);

    /**
     * 微会员注销接口
     *
     * @param token
     * @return
     */
    int LognOut(String token);

    /**
     * 重置微会员的密码
     *
     * @param
     * @return
     */
    int ResetPassword(OperationContext context, OperateIndentifyTransfer operate);

    /**
     * 微会员绑定手机号
     *
     * @param
     * @return
     */
    int BuindTel(OperationContext context, OperateIndentifyTransfer operate);

    /**
     * 微会员应用端推荐明星会员查询接口
     *
     * @param searchCriteriaBase
     * @return
     */
    Map<String, Object> getMemberList(OperationContext context, SearchCriteriaBase searchCriteriaBase);

    /**
     * 微会员应用端会员个人信息查询接口
     *
     * @param context
     * @return
     */
    MemberBase getQueryMember(OperationContext context, Integer userId);

    MemberBase getInfo(int userId);

    /**
     * 修改接口
     *
     * @param context
     * @param memberBase
     * @return
     */
    int updateMember(OperationContext context, MemberBase memberBase);


    int updateMemberPassword(OperationContext context, String password, String newPassword);

    int bindMobile(OperationContext context, String mobile, String code);


    /**
     * 校验验证码
     *
     * @param mobile
     * @param type
     * @param code
     */
    void checkCode(String mobile, String type, String code);
}
